/*  Lognsoft Copyright 2010
    BSD License
*/

#ifndef __COUMO_SYS_H__
#define __COUMO_SYS_H__

struct ln_thread_t;
typedef struct ln_thread_t * LN_THREAD_PTR;

struct ln_sys_api_t
{
  LN_THREAD_PTR  (*current_thread)();
  LN_THREAD_PTR  (*create_thread) ( void(*)(void*), void* host, const char* name);
  int            (*close_thread)  (LN_THREAD_PTR thrd);
  const char*    (*error_message) (LN_THREAD_PTR thrd);
  int            (*error_code)    (LN_THREAD_PTR thrd);
};

extern struct ln_sys_api_t *  ln_sys_api_vt;

#define ln_current_thread   (ln_sys_api_vt->current_thread)
#define ln_create_thread    (ln_sys_api_vt->create_thread)
#define ln_close_thread     (ln_sys_api_vt->close_thread)
#define ln_error_message    (ln_sys_api_vt->error_message)
#define ln_error_code       (ln_sys_api_vt->error_code)

#endif//__COUMO_SYS_H__